﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Dazzle {
    public partial class GraphView : Form {
        private GraphBox _box;

        public GraphView(GraphBox box) {
            _box = box;
            InitializeComponent();
        }

        private void GraphView_Load(object sender, EventArgs e) {
            if (_box != null) {
                panel2.Controls.Clear();
                panel2.Controls.Add(_box.Chart);
            }
        }

        private void GraphView_FormClosing(object sender, FormClosingEventArgs e) {
            if (_box.LastVerb == Win32.OLEIVERB_SHOW) {
                _box.Update();
            }

            _box.Close();
        }

        private void btnOk_Click(object sender, EventArgs e) {
            Close();
        }
    }
}
